﻿using ESC.DB;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;

using System.Windows.Data;
using System.Windows.Media;

namespace ESC.Designer.Resources
{
    public class RuncardInfoQTYExConvert : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            RuncardInfoView view = value as RuncardInfoView;
            if (view != null)
            {
                decimal? d1 = view.inCount;
                decimal? d2 = view.caninqty;
                if (d2 == null)
                    return d1;
                else
                    return d2;
            }
            return "";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
